﻿using System;

using Prism.Ioc;
using Prism.Regions;


namespace Sensing.Auto.Laser.Core.Mvvm
{
    public class RegionViewModelBase : ViewModelBase, INavigationAware, IConfirmNavigationRequest
    {
        public IRegionManager RegionManager { get; private set; }
        protected IContainerProvider Container { get; private set; }

        public RegionViewModelBase(IRegionManager regionManager, IContainerProvider container)
        {
            RegionManager = regionManager;
            Container = container;
        }

        public virtual void ConfirmNavigationRequest(NavigationContext navigationContext, Action<bool> continuationCallback)
        {
            continuationCallback(true);
        }

        public virtual bool IsNavigationTarget(NavigationContext navigationContext)
        {
            return true;
        }

        public virtual void OnNavigatedFrom(NavigationContext navigationContext)
        {

        }

        public virtual void OnNavigatedTo(NavigationContext navigationContext)
        {

        }
    }
}
